import java.io.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;

public class Actions {
	private String findword;
	public void finD( ) {
		try {findword = JOptionPane.showInputDialog("Type the word to find");
while(n.getTextArea().getText().indexOf(findword) == -1) {
JOptionPane.showMessageDialog(null, "Word not found!", "No match", JOptionPane.WARNING_MESSAGE);
findword = JOptionPane.showInputDialog("Type the word to find");
}
n.getTextArea().select(n.getTextArea().getText().indexOf(findword), n.getTextArea().getText().indexOf(findword) + findword.length());
} catch(Exception ex) {
JOptionPane.showMessageDialog(null, "Search canceled", "Abourted", JOptionPane.WARNING_MESSAGE);

}

	}

	public void findNexT( ) {
		n.getTextArea().select(n.getTextArea().getText().indexOf(findword, (int) n.getTextArea().getText().indexOf(findword) + 1), n.getTextArea().getText().indexOf(findword, (int) n.getTextArea().getText().indexOf(findword) + 1));
	}

}
